Skip to content

feat(cli): expose application commands over MCP - #690

Open
kmbroai wants to merge 3 commits into
dev/kyleb/mcp-scansfrom
dev/kyleb/mcp-commands
Open

feat(cli): expose application commands over MCP#690
kmbroai wants to merge 3 commits into
dev/kyleb/mcp-scansfrom
dev/kyleb/mcp-commands

Conversation

@kmbroai

@kmbroai kmbroai commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

MCP clients can currently run scans but must switch to the CLI for the rest of the security workflow. This adds application workflow commands to the same MCP server, so agents can inspect saved scans, import and triage findings, validate or patch them, export results, and publish findings.

Stacked on #682. This PR targets dev/kyleb/mcp-scans and incorporates the updated #682 branch after its merge from main.

Changes

  • Expose 20 additional tools, for 22 total: component and bulk scans; scan history, rerun, matching and comparison; finding history and triage; GitHub import; export; validation; fix verification; patching; publication checks and publication; hook installation; login status and logout.
  • Derive typed inputs from the public CLI manifest. New tools accept args, options, and optional workingDirectory; command group names use underscores. Existing scan and info inputs stay unchanged. No CLI commands, flags, environment variables, or defaults change.
  • Run each new tool through the existing CLI in a separate process, retaining its environment, credentials, exit status, structured results or raw output, and stderr diagnostics. Cancellation and disconnects wait for CLI subprocess cleanup; artifacts are retained.
  • Keep browser/device sign-in, credential entry, shell completions, MCP/skills installation helpers, and the newer serve and dedupe commands as local CLI actions. Preserve the existing 22-tool MCP scope during the merge and expose only Linear publication, without custom-publication-only inputs.
  • Document tool names, examples, side effects, noninteractive inputs, and CLI positional argument limitations. Extend installed-package smoke coverage and package contents validation, with the hook fixture isolated from global Git hooks configuration.
  • Add Git to the Docker package-validation stage, which already includes Python on main, so the MCP smoke tests run in the minimal build image. Runtime requirements are unchanged.

Testing

  • 244 focused CLI, MCP, mock-scan, and authentication tests passed with zero failures. Discovery still exposes exactly 22 MCP tools; publication tests reject custom-only options.
  • Generated-model consistency, MCP and SDK TypeScript checks, package formatting, and git diff --check: passed.
  • Portable plugin Ruff checks and source compatibility checks: passed.
  • Production build and complete packed/installed npm package validation passed with 402 archive entries and 122 bundled plugin files, including MCP scan preflight, history, CSV export parity, publication dry-run, hook installation, native Node lifecycle/terminal contracts, dashboard assets, and the nested worker.
  • Three independent native reviews and independent verification of the exact merge commit: passed.

Tests use isolated synthetic fixtures; no billable scans, changes to existing credentials, or external issue publication were performed.

Risk and rollout

#682 must merge first; this PR can then be retargeted to main. Neither PR is merged by this change.

The new tools have the same local filesystem and credential access as the CLI. Some commands can make billable model calls, modify files or stored findings, remove stored sign-in, or publish external issues and pull requests; tool annotations and server instructions describe those effects. Cancellation stops work but does not roll back completed side effects. Authentication setup remains outside MCP, and commands that normally offer terminal pickers need explicit inputs.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-02T00:04:08.665615Z 97af97f New commits

Security findings

Blocking findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 97af97f304

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/src/cli-mcp-commands.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant